0 REM COMMODORE-64 DEMO PROGRAM 1 REM DAVID BEREZOWSKI / COMMODORE CANADA / APRIL 82 2 REM WITH APOLOGIES TO THE CODE! 3 REM C64 MAIN DEMO PROGRAM 5 IF F=0 THEN F=1:LOAD "SPRITE.DATABIN.D",8,1 6 IF F=1 THEN F=2:LOAD "BOUNCE M/C.D",8,1 10 REM C64 DEMO TITLE 15 POKE13*4096+33,6:REM BLUE BACK 16 POKE13*4096+32,13:REM LT GREEN FORE 20 C$="[144][159][156][158]" 30 PRINT "[147]";CHR$(142):PRINT:PRINT:PRINT 40 A$="I N T R O D U C I N G":GOSUB 140 50 PRINT:PRINT:A$="[159]THE":GOSUB 140 60 PRINT:PRINT:A$="[158]NEW":GOSUB 140 70 PRINT:PRINT 80 A$="[156]COMMODORE-64":GOSUB 140 90 PRINT:PRINT:A$="PERSONAL COMPUTER":GOSUB 140 100 FOR Z=1 TO 3 110 FORX=1 TO 7:A$=MID$(C$,X,1)+MID$(A$,2):PRINT"[145]";:GOSUB 140 120 FOR Y=1 TO 100:NEXT Y,X,Z 125 FOR Z=1 TO 500:NEXT Z:SYS 28672:REM CALL BOUNCE 130 POKE198,0:GOSUB 5000:GOTO 200:REM LINK TO C64 DESCRIPTION 140 REM CENTRE A$ ON SCREEN 150 PRINT SPC((40-LEN(A$)-1)/2);A$ 160 RETURN 200 REM C64 DESCRIPTION 210 PRINT"[147][155]";CHR$(14):C=5 220 GOSUB 450:GOSUB 350:GOSUB 240:GOSUB 700 230 GOTO 1000:REM LINK TO C64 VIC-MAN EATS APPLE 240 PRINT "[147][146] [208][197][210][201][208][200][197][210][193][204][211] :" 250 PRINT 260 PRINT SPC(C)"- [214][201][195] [195]ASSETTE [196]ECK":PRINT 270 PRINT SPC(C)"- [214][201][195] [196]ISK (170K)":PRINT 280 PRINT SPC(C)"- [214][201][195] [208]RINTER (80 COLUMNS)":PRINT 290 PRINT SPC(C)"- [214][201][195] [205]ODEM (DIRECT CONNECT)":PRINT 300 PRINT SPC(C)"- [195][194][205]/[201][197][197][197] [208]RODUCTS" 310 PRINT SPC(C)" (WITH [201][197][197][197] CARTRIDGE)":PRINT 320 PRINT SPC(C)"- [214][201][195] [202]OYSTICKS":PRINT 330 PRINT SPC(C)"- [214][201][195] [199]AME [208]ADDLES":PRINT 340 GOSUB 590:RETURN 350 REM EXPANSION 360 PRINT "[147]":C=5 370 PRINT " [197][216][208][193][206][211][201][207][206] :":PRINT 380 PRINT SPC(C);"- [205]ACHINE [204]ANGUAGE [205]ONITOR":PRINT 390 PRINT SPC(C);"- [211]UPER [197]XPANDER":PRINT 400 PRINT SPC(C);"- [201][197][197][197] CARD ":PRINT 410 PRINT SPC(C);"- [208]ROGRAMMERS [193]ID":PRINT 420 PRINT SPC(C);"- [218]-80 [195]ARD ([195][208]/[205])":PRINT 430 PRINT SPC(C);"- [195][194][205] [194][193][211][201][195] 4.0":PRINT 435 PRINT SPC(C);"- [208][197][212] [197]MULATOR CARTRIDGE":PRINT 440 GOSUB 590:RETURN 450 REM FEATURES 460 PRINT "[147] [198][197][193][212][213][210][197][211] :":C=3:PRINT 470 PRINT SPC(C);"- GREAT [211][208][210][201][212][197] GRAPHICS":PRINT 480 PRINT SPC(C);"- [211][201][196] SOUND SYNTHESIZER CHIP":PRINT 490 PRINT SPC(C);"- 64[203] [210][193][205]":PRINT 500 PRINT SPC(C);"- 38[203] [210][193][205] FOR [194][193][211][201][195]":PRINT 510 PRINT SPC(C);"- POWERFUL [208][197][212] [194][193][211][201][195] 2.0":PRINT 520 PRINT SPC(C);"- [200]I-[210]ESOLUTION GRAPHICS (320 X 200) 530 [153] [166]C);" (64,000 INDIVIDUAL PIXELS)":[153] 540 [153] [166]C);"- 16 COLORS (STOP   OPEN CLR   SYS REM VERIFY DEF POKE PRINT# PRINT CONT LIST WAITLIST)":[153] 550 [153] [166]C);"- (null)(null)(null)VAL(null) AND LOWER CASE":[153] 560 [153] [166]C);"- 40 COLUMN (null) 25 LINE DISPLAY":[153] 570 [153] [166]C);"- USER PROGRAMMABLE CHARACTERS" 580 [141] 590:[142] 590 [143] DELAY 600 [153]"CHR$-CHR$(null)/(null)-(null)(null)(null)(null)"; 605 DD[178]2000:[129] Y[178]1 [164] DD 610 [161] A$:[139] A$[178]"" [167] [130] Y:[142] 620 [139] A$[178]"G" [167] Y[178]DD:[130] Y:[142] 630 [139] A$[179][177]"S" [167] 610 635 [153]"(null)(null)(null)(null)(null)VALSTR$WAIT "; 640 [161] A$:[139] A$[179][177]"G" [167] 640 645 [153]"WAIT "; 650 Y[178]DD:[130] Y:[142] 700 C[178]3:[143] SID CHIP DESCRIPTION 710 [153] "LOADWAIT (null)RIGHT$STR$ - SOUND SYNTHESIZER CHIP!" 730 [153]" * 3 INDEPENDENT VOICES, EACH WITH:" 740 [153] [166]C);"- 9 OCTAVES RANGE." 750 [153] [166]C);"- 4 WAVEFORMS: SAWTOOTH, TRIANGLE, 755 PRINT SPC(C);" VARIABLE WIDTH PULSE, AND NOISE. 760 [153] [166]C);"- AMPLITUDE MODULATION. 770 PRINT SPC(C);"- CONTROL OF ATTACK, DECAY, SUSTAIN, 775 [153] [166]C);" AND RELEASE OF EACH VOICE. 780 PRINT SPC(C);"- PROGRAMMABLE LOW, HIGH, 785 [153] [166]C);" AND BAND PASS FILTERS. 790 PRINT SPC(C);"- MASTER VOLUME CONTROL. 795 [141] 590:[142] 1000 [143] 1010 [156]:S[178]2:[153][199](14) 1020 [143] GREAT SPRITE GRAPHICS FEATURING. 1030 [143] ARCADE-GAME EFFECTS 1040 G[178]13[172]4096:[151]G[170]32,13:[151]G[170]33,0 1050 [153]"LOAD (null)(null)(null)RIGHT$(null)VAL CHR$RAPHICS FEATURING... 1060 REM PA=SPRITE PAGE DEF. 1070 REM SP=SPRITE # 1080 REM SC=SPRITE COLOUR 1090 REM *** START *** 1100 PA=150:SP=6:SC=7:GOSUB 1340 1110 PA=151:SP=3:SC=2:GOSUB 1340 1120 PA=152:SP=4:SC=9:GOSUB 1340 1130 PA=153:SP=5:SC=14:GOSUB 1340 1140 PA=154:SP=2:SC=7:GOSUB 1340 1150 PA=155:SP=2:SC=7:GOSUB 1340 1160 PA=156:SP=2:SC=7:GOSUB 1340 1170 POKEG+28,8+16+32+64 1180 POKEG+37,5:POKEG+38,8:REM GRN,ORNGE 1190 PRINT" [193][210][195][193][196][197]-[199][193][205][197] [197][198][198][197][195][212][211]!" 1200 OX=150:OY=90 1210 CC=CC+1:IF CC>2 THEN GOSUB 5000:GOTO 2000:REM LINK TO C64 SUN PICTURE 1220 X=OX:Y=OY:SP=6:GOSUB1310 1230 X=OX:Y=OY+21:SP=3:GOSUB1310 1240 X=OX:Y=OY+25:SP=4:GOSUB1310 1250 X=OX:Y=OY+29:SP=5:GOSUB1310 1260 X=0:Y=103-GZ*10:SP=2:GOSUB1310:POKEG+21,124:POKEG+23,4*GZ:POKEG+29,4*GZ 1270 FORI=0TO136STEPS:POKEG+4,I:POKE2042,154+C:C=C+1+(C=2)*3:NEXT 1280 POKEG+21,4:FORI=137TO255STEPS:POKEG+4,I:POKE2042,154+C:C=C+1+(C=2)*3 1290 NEXT:FORI=1TO1000:NEXT:POKEG+21,0:GZ=1-GZ:GOTO1200 1300 END 1310 V1=XAND255:V2=255:V3=2^SP:IFX<256THENV2=255-2^SP:V3=0 1320 V4=(PEEK(G+16)ORV3)ANDV2:POKE G+SP*2+1,Y:POKE G+SP*2,V1:POKE G+16,V4 1330 RETURN 1340 G=13*4096 1350 POKE2040+SP,PA 1360 POKEG+39+SP,SC 1370 RETURN 1380 I=1:J=1:X=100:Y=100 2000 CLR:G=13*4096:POKE G+32,13 2010 REM SPRITE GRAPHICS FEATURING... 2020 REM REAL-TIME ANIMATION 2030 PRINT"[147]";CHR$(142);"[144] SPRITE GRAPHICS FEATURING..." 2040 PRINT" REAL-TIME ANIMATION! 2045 [153]" (ANIMATION DONE BY 8 LINES OF BASIC) " 2050 [143] PA=SPRITE PAGE DEF. 2060 [143] SP=SPRITE # 2070 [151] G[170]21,0:[143] DISABLE ALL SPRITES 2080 PA[178]157:SP[178]5:X[178]0:Y[178]0:[141] 2420:[141] 2400:[143] SUN 2090 PA[178]158:SP[178]2:X[178]0:Y[178]0:[141] 2420:[141] 2400:[143] WHITE CLOUD 2100 [151]G[170]23,20:[151]G[170]29,20 2110 PA[178]159:SP[178]3:X[178]0:Y[178]0:[141] 2420:[141] 2400:[143] PLANE 2120 PA[178]158:SP[178]4:X[178]0:Y[178]0:[141] 2490:[141] 2400:[143] GRAY CLOUD 2130 [151]G[170]39[170]5,7:[143] YELLOW SUN 2140 [151]G[170]39[170]2,1:[143] WHITE CLOUD 2150 [151]G[170]39[170]3,2:[143] RED PLANE 2160 [151]G[170]39[170]4,15:[143] GRAY CLOUD 2170 [151]G[170]28,0:[143] MULTI-COLOR MODE OFF 2180 [151]G[170]27,32[170]16:[143] SUN & GRAY CLOUD BEHIND TEXT PRIORITY 2185 [151]G[170]21,4[170]8[170]16[170]32:[143] ENABLE ALL SPRITES 2190 [137]2290 2200 WC[178]WC[170]C0:SU[178]SU[170]C1:PL[178]PL[170]C2:GC[178]GC[171]C0 2210 [151]G1,WC:[143] UPDATE WHITE CLOUD X POS 2220 [151]G2,SU[170]25:[143] UPDATE SUN Y POS 2230 [139]SU[177]C3[175]SU[179]C5[175]F[167][151]G3,D(C4[171](C5[171]SU)[173]C6):[137]2250 2240 [139]SU[177]C5[175]F[167]2600 2250 [151]G4,PL[175]C7:[151]G5,[171]C8[172](PL[177]C7) 2260 [151]G6,GC:[143] UPDATE GRAY CLOUD X POS 2270 C[178]C[170]C2:[139]C[179]C9[167]2200 2280 [129]X[178]1[164]1500:[130]X 2285 [141] 5000:[137] 10:[143] RESET VIDEO CHIP AND LOOP 2290 [156]:G[178]13[172]4096:G1[178]G[170]4:G2[178]G[170]11:G3[178]G[170]33:G4[178]G[170]6:G5[178]G[170]16:G6[178]G[170]8:F[178][171]1 2300 C[178]0:C0[178].5:C1[178].205:C2[178]1:C3[178]50:C4[178]6:C5[178]71:C6[178]3.5:C7[178]255:C8[178]8:C9[178]395 2310 [151]G[170]44,7:[143] YELLOW SUN 2320 WC[178]50:[151] G[170]4,WC:[151]G[170]5,70:[143] WHITE CLOUD 2330 PL[178]0:[151] G[170]6,PL:[151]G[170]7,90:[143] PLANE 2340 GC[178]245:[151] G[170]8,GC:[151]G[170]9,75:[143] GREY CLOUD 2350 SU[178]10:[151] G[170]10,90:[151]G[170]11,SU:[143] SUN 2360 [151]G[170]33,14 2370 [141] 3150:[141] 3270 2390 [137] 2200 2400 [151] G[170]SP[172]2,X:[151] G[170]SP[172]2[170]1,Y 2410 [142] 2420 [143] 2490 [151]2040[170]SP,PA 2510 [142] 2600 [151]2045,160:[151]G[170]44,1:SU[178]78:[151]G[170]11,SU[170]25:[151]G[170]10,175:C1[178][171]C1[171]C1:F[178]0 2610 [137] 2250 3150 [153]"":[143] DRAW MOUNTAIN RANGE 3160 [153]" STEP(null)" 3170 [153]" STEP(null)WAIT STEP (null)WAIT STEP(null)WAIT" 3180 [153]" STEP (null)STEP (null)WAIT STEP (null)" 3190 [153]"STEP (null) (null)STEP(null)WAIT STEP (null) 3200 PRINT" [206] [206] [223][146] [169] [223]" 3210 PRINT" [206] [205] "; 3220 PRINT" "; 3230 PRINT" "; 3240 PRINT" "; 3250 PRINT" "; 3260 RETURN 3270 REM DARK SKY ARRAY 3280 D(0)=14:D(1)=14:D(2)=6 3290 D(3)=12:D(4)=12:D(5)=11:D(6)=11 3300 RETURN 4000 REM EXTENDED COLOR MODE 4010 G=13*4096 4020 PRINT"[147]" 4030 PRINT SPC(10)"[197][216][212][197][206][196][197][196] [195][207][204][207][213][210] [205][207][196][197]!" 4040 FOR X=0 TO 255 4050 POKE1024+160+X,X:NEXT X 4060 PRINT"" 4070 A$="[201]N THIS MODE WE CAN CHANGE THE CHARACTER":GOSUB 4210 4080 A$="COLOUR OF ANY BLOCK OF 64 CHARACTERS ":GOSUB 4210 4090 A$="INDEPENDENT OF THE OTHER 192 CHARACTERS.":GOSUB 4210 4100 PRINT:A$="[215][193][212][195][200]!...":GOSUB 4210 4110 FOR Y=0 TO 100:NEXT Y 4120 POKEG+17,PEEK(G+17)OR64 4130 FOR Z=1 TO 30 4140 R=RND(1)*4:REM PICK A RANDOM BACKGROUND REGISTER 4150 C=RND(1)*16:REM PICK A RANDOM COLOR 4160 POKEG+33+R,C 4170 FOR Y=0 TO 199:NEXT Y,Z 4180 POKEG+17,PEEK(G+17)AND191 4190 END:REM LOAD NEXT PROGRAM 4200 END 4210 REM OUTPUT A$ 4220 FOR X=1 TO LEN(A$) 4230 PRINT MID$(A$,X,1); 4240 FOR Y=0 TO 49:NEXT Y,X:RETURN 5000 G=13*4096:REM FIX CHIP 5005 PRINT"[147]":POKEG+21,0:RESTORE 5010 FOR X=0 TO 16:POKEG+X,0:NEXT 5020 FOR X=17 TO 46 5030 READY:POKEG+X,Y:NEXT 5040 RETURN 5050 DATA 27,175,226,228,0,200,0,21,121,240,0,0,0,0,0,254,246,241,242,243,244 5060 DATA 240,241,242,243,244,245,246,247,252